#include <stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    while (t--)
    {
        char c[3];
        double a,b,d;
        scanf("%s%lf%lf",c,&a,&b);
        if (c[0]=='+')d=a+b;
        if (c[0]=='-')d=a-b;
        if (c[0]=='*')d=a*b;
        if (c[0]=='/')d=a/b;
        if (d==int(d))printf("%d\n",int(d));
        else printf("%.2lf\n",d);
    }
    return 0;
}